#include "strings_def.h"
#include <m_ctype.h>
#include <my_xml.h>
+#include <stdint.h>
/*
gives about 10% performance improvement comparing
to byte-by-byte loop.
*/
- for ( ; length >= 4; length-= 4, from+= 4, to+= 4)
{
- if ((*(uint32*)from) & 0x80808080)
- break;
- *((uint32*) to)= *((const uint32*) from);
+ const char *from2= from;
+ for ( ; ((uintptr_t)from & 3) != 0
+ && ((*from & 0x80) == 0)
+ && length >= 4;
+ length--, from++);
+ if (((uintptr_t)from & 3) == 0)
+ {
+ for ( ; length >= 4; length-= 4, from+= 4)
+ {
+ if ((*(uint32*)from) & 0x80808080)
+ break;
+ }
+ }
+ memcpy(to, from2, length2 - length);
+ to+= (length2 - length);
}
#endif /* __i386__ */